refactor microphone.js