refactoring for hashset
basic hashset implementation