Change bot structure to more pythonic code