More cleanup/refactoring of the controller search trait