Refactored robot class