Cms refactor