improved key handling in maps