Clean up completion middleware a bit