search service,controller and view refactoring