Thanks for the pull request. I do not think that "dirty" is a good way to describe another pull request from a contributor. The regression was probably not anticipated, everybody makes mistakes sometimes.
@linuxmaniac can you maybe also do a quick review on the refactoring done in this request?