Optimize and refactor search controller with custom one line db query class methods.