refactored app structure