refactored makeRequest