Diffraction.py refactorings.