Improved the controller classes. Added create_controller function.