core: improve tainting feature