Refactor dependency manager