Small refactoring to #54.
Thank you @jbt & @hamann!

Closes #47