Tidying and documentation