Tidy up and document