Start cleaning up code for base template.