better parse template