core: refactoring - dict.get instead of if