javascript: remove unused code
javascript: optimize arrays