Update dictionary and array access to modern idioms