Use a hash rather than flattened arrays