Man, this is ugly. I wonder if java usage is reason enough to break these out as named classes (even if it's ugly).