Added a factory free function