Refactor html templates to use a base template