Do we need a null check here? And why not use getMap() instead of map here?