Merge "Minor code cleanup to enable reuse of the protocol." into klp-dev