refactored foobot #474