refactored factories
merge conflict fix