cleanup for JS generation