CPK refactored for 5.0 (still needs a bit of attention)