some more refactoring, adapted tests