Further improvements to reduce JS usage