refactored dependencyhandling