Refactor. Made the app more modular and changed the startup process