Speedup

A perhaps-less-contentious refactoring which nonetheless brings a significant speedup.