extract shared code for channel and select specs