minor cleanup for JS generation