some handy bits of ring middleware