Extracted request methods to a different file and instead of integeres now Requests is a class which each member is an instance of request which has a method to perform the request. So this code avoids the if clause each time the client performs a request