Refactored duplicate code on Poll controller