internal tidy up.