Script tidying