PKX lib Code Cleanup