Remove duplicate code
Add separate search-window