Adjust middleware to be functions that take a client instead of a thing that takes a client and has methods.