refacotring run file