Refactoring on robot1