further minor refactoring