Trainer and brain refactorization