improved scripts compression