refactor robot class to reduce complexity