Minor refactoring
Yet more partial implementation of issue #7