Improved formatting and comments in background.js