Code Refactoring: csv custom dictionary