Some JS enhancements