Refactored the app a bit since a lot of stuff was being reused.