refactor dictionary lookup using get method