Smarter dependency tracking