Some minor refactoring (#112).