Refactored addition of HTML opening and closing tags to their own methods.