extracted script file reading into a general function