Minor cleanup of extraction code for inclusion in activator.