I'll probably look at moving this into a class very soon.