More dict refactoring