documentation and optimization