Updating documentation and refactoring.