Refactor to support SharedHashMap