add smarter dependency checking