Refactoring /autofly command.