changed factory helper method Map by Pair