Refactor hashmaps/sets for posterity