made code modular