Refactored the models and html files