continuing to organize code and simplify the templates