refactor kiwi_http_handler