Refactor to request-response model