clean up JS source code