Use the get method to access values in a dict.

While I understand that probably this is also a controversial PR, in my favor I would like to say that the change reduces an unnecessary level of nesting and avoids a superfluous `try/except` block. Also, I feel that the `get` method is a more pythonic way to access dictionary elements. :)