HTML Homeworks code refactoring