Some template cleanup