Extracted creation of factories to helper method