method documentation, more optimizations