cleanup & refactorings for shared hash table for shared groupby