extract controller into its own file