A bit js improvements