move survey-related function to appropriate module