refactoring Robot class