enhance dependency detection (either internal function or class method