I see this line over and over again in this code. When you see an overblown code, you dehydrate it. What do you do and you see a copy-paste code? You minimize it. This is the case when you want to create a php function at the beginning of this function and use it.