Add option to factory function to avoid guessing data type.