refactoring in getDict process