improved js helpers