refactor bot