minor improvements in js