Improve base controller and model