separated training model from submitting query