modular example, plus some clean up