search controller and service code refactoring