compacting secure scripts