more refactoring re #573