sortedMap

code refactoring