Filter unnecessary keys and rename certain keys.