Refactorings and documentation