Refactored dependency handling to use a range.