cleaning up code with indifferent access hashes