Code refactoring
Use two level hash to classify fields