Use filters to make the filtering and processing separate
Move this to a common location