restructured app to be a little more efficient and readable (to me)