Some refactoring to dialogue