clean up app controller code