Refactoring and documentation.