refactoring on js code for new lowlatencyaudio plugin