return pointer to struct from factory instead of interface