Slight refactor of background.js and recorder.js