Removes code duplication (code climate)

No gain but it's "better": https://codeclimate.com/github/Mogztter/asciidoctor/compare/code-climate
Ruby is not a procedural language! Please avoid writing methods that communicates through modifying the input argument instead of return value. It’s very confusing, unsafe and ugly. The better approach is to stick to “functional” methods without side effects, if you don’t have a good reason to not do it.