*8148* Move common code to PKP lib