Split createRequest into two functions
Cleaned up createRequest