switched collection to a map to improve updating time