Refactoring and documenting the src