refactoring conversation handling