Before script cleaning