Refactor on #78

This is entirely cleanup for #78. There should be no change in the actual output of the mod.