Refactor dependency checker