refactored controllers to use the searchFactory