added templates and extracted partials