Re-structure html using templates and partials