Issue #155: Minor refactor, comments and additional tests.