Re-writing CMS function