Refactored polling into separate class