Move code to front page template