remove duplication from factory