Refactoring and documenting