Updated to use controller and model