cleaned up DiffMain interface by refactor into unexported func