few js enhancements