Some refactoring (#112).