Refactored code for filtering by tags: thin controllers and fat models