Revised the Trainer class