Distinct population of TECs of cortex and medulla mediates both of these critical functions.