Improving the foliage tool performance