Some refactoring; --diff produces files instead of printing.