Refactoring structure of Chat solution.