improve type inference for dictionaries