1. A computer-implemented method of refactoring a web-based application, comprising: monitoring a plurality of requests received from a client application interacting with the web-based application; monitoring a generated response for each of the plurality of requests, wherein each generated response is a markup-language document generated in response to the request and is transmitted to the client application for rendering; identifying at least one pattern between the plurality of requests and the generated responses, wherein the pattern shows a correlation between a first request and a corresponding generated response; and refactoring the web-based application based on the at least one pattern, wherein the refactoring comprises: generating a server component, wherein the server component is configured to generate a portion of one of the markup-language documents, and generating a client component to embed in the markup-language document generated for the first request, wherein the client component is configured to invoke the server component to update at least a portion of the markup-language document corresponding to the first request.