Refactored to moved models and controllers to separate files