Tidy inner functions.