Inherited some outsourced code which was the worst code I've ever seen in 30 years of professional development. The outsourced devs were expected to write 200 lines of code per day. Their motivation was not good code but to hit this volume.
We insourced it, where our devs were motivated to write code for themselves (and each other).
In a previous life, I was a mechanical engineer and interviewed at an engine research company. I know a lot about engines but the three engineers interviewing me were world experts. Format was me standing in front of a whiteboard and the panel firing questions at me, picking apart my answers and bottoming out my knowledge.
It was all very high stress with questions and answers going back and forth. There was a long pause which was broken by one of the engineers asking:
"Do you drink beer?"
We insourced it, where our devs were motivated to write code for themselves (and each other).