Cleaned up duplicate code, moved poll node function to central class