Yeah, I thought this was ugly too, but I'm not sure of the best approach.