Move filter parsing into separate module