Further improvements to documentation
Refactor and cleanup