Clean up how settings are passed into middleware
Post payload in a thread