sample refactor CMS code out of core