Refactor the robot code use strategy pattern.