converted controller to first-class object