lots of tidying up