pulled functions and vars out of "app" object because it didn't seem useful