More refactoring
More refactoring -- fixes #16.