refactor and add for robot