Optimization changes.

JS Changes to improve selectors and flux