Refactored models and search