Minor refactorings
Fixes #3