CMS refactor