The good news is that by changing your D7 chord to have an E as the highest note, you've made a more advanced V chord with interesting voice leading that sounds better. Don't think about it any deeper than that. Don't change any of the other notes in the chords. Just take the D7 chord you know and love and change the highest note from D to E. If we think about it as notes, it might get a little confusing, but if we look at closer, it's actually really simple.
Let's connect the Am7 and D7 chords by keeping the E the same between the two chords. The top voice started with an E in the Am7, went down to a D in the D7, and then stayed put as a D in the Gmaj7. To begin with, let's just focus on the highest note in the chords, which in the case of Ex. This is called voice leading, and while you can get quite advanced about this, you can also do some incredibly simple voice leading that make a big impact. A simple way that you can make your chords sound a bit more interesting is to connect the chords together in the smoothest way possible.