During when Prowl and Jazz were Cyberninja meditating to pull in the Allspark fragments, the one that had kept Starscream alive all this time after he'd died so many times had been ripped out of his helm by the force.
After the battle and everything was done and relatively back to normal, you'd found his greyed frame, which you'd promptly given him an Allspark fragment that you'd taken and put it in his spark chamber.
Once he'd woken up, you knocked him out and carried his now alive frame back to the Autobot base to Ratchet's medical supplies, and got to work with his processor.
You'd been able to change some of his coding and had even changed his insignia to the Autobot one, but you'd kept all his memory banks because getting rid of them would just be cruel.
You hadn't told Optimus and the rest about this, but had convinced them to stay behind on Earth instead of following them back to Cybertron so you could clean up, and you technically weren't lying.
You'd finished your attempt at changing Starscream's coding not too long ago, and he was about to online.
Let's hope this doesn't blow up in your faceplate.