Refactoring html templates