refactor search into own template and view