cleanup of javascript