a more modular approach