Implemented abstract classes for model class and controller class and moved generalized functions in there