Some minor refactoring (#143).