try to optimise the js a bit more