Refactor countersignature implementation.