refactored dependency resolution