javascript: improvements