Reorganising to make JS concatenation work better.