avoid loop, turn to a map and lambda expression.