Refactored the poll thread detection mechanism into it's own class.