moves controller and init calls to top of html