Added MainHandler for templates