Some refactoring
create abstractchat class and methods