Updates to template and gen