javascript improvements