moved helper functions into surveytools package