minor refactorings for #24