move controller into its own file