Refactor move command.