Refactor by node type, also add a class dependency.