That's beginning to look like code I can be less ashamed of than usual.