Refactor frontpage template