Split file into multiple scripts and add multi-threading