Simplify.  Also, more logical order.
Beginning of filter parsing.  Needs extension framework in order to wrap up.