improved dependency handling