added a factory class