Pulled out the filters into reusable code