made the code modular