Removing unnecessary keys