factory to remove duplication