moved trainer.rb to models from spec/models