Refactor: filter
Refactor: Create a filter function