improve CMS parsing