Using a factory constructor