Code cleanup and conversation refactoring first phase.