Refactored the models