Improved monitor background code