Refactored documentation parsing to separate logic from display.