using get or default in Map to get the code more cleaner

using get or default in Map to get the code more cleaner