This looks familiar. :-) Probably a good idea to put in the appropriate Util and share this.