changed type names and migrated filter functions to a single function with a parameter