Refactor API calls in Decoder and Microphone