Doing some code clean up and trying to make the app stable