remove used imports.

close stream.
remove Deprecated method.
replace hashtable to hashmap.