Fix #37 (closed). The code does look simpler.
This will create a new commit in order to revert the existing changes.