Did some cleanup, since there is talk of moving this to common code.