Fully implemented encapsulation functions in CMS