split off domdiff code