"Massive rewrite" to accommodate switching versions