Refactor the way dependencies are handled.