Add support for training mode