What has this to do with the concept of the Middle Way? In refuting the Vedic teachings on the elements as sacro-saint, Buddha presents another set of thoughts that will form the core of his teachings. Not the worshipping of elements/gods is central here, but a developing of the moral, and hence intellectual being.
The well known first teaching, the Setting in motion the Wheel of the Dhamma/Dharma Buddha says:
“… And what, monks, is that MIDDLE WAY awakened to by the Tathāgata (Buddha), which gives rise to vision … which leads to Nibbāna (enlightenment)? It is this noble eightfold path; that is: right view, right intention, right speech, right action, right livelihood, right effort, right mindfulness, right concentration. This, bhikkhus, is that middle way awakened to by the Tathāgata, which gives rise to vision, which gives rise to knowledge, which leads to peace, to direct knowledge, to enlightenment, to Nibbāna. …”