Removing extra keys and adding code steps