Moved all generic code to js/app