refactored app start task and added stop task