Refactor class dependencies.