Mild cleanup on the prefix computation