Centralize the request in a function, and some debugging