clean up code for different gunicorn versions