Documentation & minor optimizations