Fixed a bug that server is not sorted in all items map.
Some refactorings.
Some updates and refactorings.