Refactored the code and added HTML file