Refactors app structure & main events