Refactoring and adding category filters