optimize request handler