refactoring the poll manager