lots more refactoring ...