Removes code duplication (code climate)

No gain but it's "better": https://codeclimate.com/github/Mogztter/asciidoctor/compare/code-climate
> No, read me note in the previous comment.

I missed the "(or is nil)" part :disappointed: 

> I don’t see it as a problem, since it makes the code more clean and readable.

I agree, I will run [benchmark](https://github.com/asciidoctor/asciidoctor/blob/master/benchmark/benchmark.rb) to make sure this isn't noticeable