Refactored bot and data connection implementation