Code reorganization. Now have separate app_master and app_stage