add factorymethod pattern