script re-organisation