Refactored out prime builder.