js additions/cleanup