more clean up of robot code