template updates + code cleanup?