Making code more modular