Extracting dependencies between classes