refactored filters as functions