script work big re-factoring