Simple refactoring - using dict get method with default values