move app processing logic into app/process