Cleaning up bot code