Refactor Filter parsing.