CS update and refactoring.
Fixed conflicts