Documentation, refactoring