major optimizations, cut back on DOM manipulation