refactored for multiple bots