refactored walking the document for its sections

improves the performance by a bit and reduces duplication.
moved the #endpoint accessor to the Operation

we're also not trying to parse the value in any longer.
this should be left to library using the value.