Improved documentation and performance