Refactor Bot.py