making scripts a bit more modular