Removing uneeded keys