Some major tidying up.