move the start logic into app