remove useless classes in document and their unit test cases
replace dom tree with hashmap