teambot refactoring