Refactoring, added some object-oriented logic

Telegram code is not pretty object-oriented yet. I'm trying to make the code more readable and cleaner