Some perf tweaks

Might stick these in the relevant JS files , but it seems to work better :)