Removes redundant keys