moved app controller into own file