Update cpkms.h

improved modularity