rewrite templates method