some refactoring for implementing array 2d hash set class