improve controller structure