Optimization and documentation