Added some methods to model and controllers