template parse and render