Dictionary refactor