Updated documentation
Optimized code structure