refactor implement of query function in EstateMap.java.