refactor dependency handler