Improve performances and reliability of imports folding