categories and search form refactored