defer works perfectly in spare_optimized.pl but it's stil could be improved