Made code modular