refactoring megabot
refactoring bots
optimize megabot logic