Put response getting into own function