refactoring cms