#169 use HashMap to improve performance