moved main and searchPage to templates