factor out constants
missing gevent import
add another monkey patch just to be safe