Refactored mock builder into definition and builder.