refactor app structure