Cleanup code and documentation