Refactoring of models and added angularjs