More modular
- modified a bit of code to make it more modular