Refactoring of factories

Simplification