Updates to documentation and refactoring