move cmscan to class and test