Tell you what, replace the bits you don't like with something involving objects, or functional programming, or whatever your particular favourite is. It's just an example and the bit you've focussed on is the least meaningful part. Of everything there, it's the most trivial and the part that could be radically changed and make no difference at all.