Added logging and refactored the search page