Rewrites to use filters instead of mass if() blocks