General library tidyup