Remove unnecessary keys.