Refactor app structure