Restructured some code so I could run app right away