greatly simplified the javascript interface