Remove unnecessary keys