make the code more modular