Refactor dependency classes.