some more general tidyups