Minor refactorings, name changes etc.