remove duplication in robot class