Refactor Search Controller