JS cleanup, modernization