Some existing application modernization technologies apply an approach that utilizes runtime traces to learn class groupings by implementing the following steps: 1) all classes are assigned to different clusters; 2) the Jaccard Similarity Coefficient for each pair of clusters is computed, where clusters with maximum Jaccard Similarities are merged; and 3) the Genetic algorithm is applied to refine the results according to some optimization objective (e.g., maximize intra-connectivity and minimize inter-connectivity). A problem with such an approach is that it does not consider the business contexts which is essential in creating groupings of classes with good business function cohesion. Another problem with such an approach is that it does not consider high order temporal dependency. Another problem with such an approach is that it aggregates the run traces into a graph, and therefore loses rich temporal information and assumes erroneous transitive relations. Another problem with such an approach is that it does not directly minimize call volume and minimize business context to improve cluster quality.