Documentation and tidying