refactor the code doing the request in its own fn