refactored the dependency resolver