Robot.py refactor