Refactoring for cotraining.