Only export factory as a function