Converted the training code to monadic code to avoid explicit carring of context and unified noisy and noisless trainers