refactoring of TaskKillActor and AppStopActor