speed up: minimize reflow; remove globals; cosmetics