Bring the milk to a boil in a small saucepan.
In another saucepan, whisk together egg yolks, sugar, corn starch, and salt, until thick and blended.
Still whisking, slowly add 2 tablespoons of hot milk to temper the egg yolks. Once whisked in, while whisking rapidly, slowly drizzle in the remaining hot milk.
Place custard mixture over medium heat, and, whisking continuously, bring to a low boil. Boil for one minute. Remove from heat.
Whisk in flavoring of your choice. Let stand 5 minutes, then whisk in butter pieces until incorporated and pastry cream is smooth.
Transfer to a bowl, press plastic wrap on the surface of the pastry cream, and cool in the refrigerator.