refactor stop/restart command