toolkitpcml minor refactoring and adding docblocks