#20 factory addition, refactoring