pigjar-56. Refactored to remove circular module dependency.