more refactoring induced by testing considerations