Add a helper function `getOrUpdateProperty` to prevent unprotected access to Maps.
getOrUpdateProperty