decoupling script from IO