cleanup and documentation