Change train from hash to struct