added preliminary factory implementation