Shared code for Pact gems