When systems evolve, the maintainability and the complexity of the system increase, resulting in the poor antidesign patterns or antipatterns in software maintenance.Refactoring is an operation used to improve the structure of an existing system by changing its internal structure without affecting its external behavior. Many studies revealed that refactoring is underused by software development team in industry due to its increased effort and lack of knowledge about existing approaches. Thus, a prioritized correction of antipatterns based on relevance of classes, analyzed development history, risk to refactor, minimized code changes, and maintainers context and preferences is needed for good refactoring recommendations. We propose an approach based on filtered relevant classes with generic linkage-based clustering and adapted nondominated sorting genetic algorithm III to find good refactoring recommendations, which maximize the software quality and reduce the refactoring effort. Our approach uses our own node centrality-based sub-graph isomorphism algorithm to dynamically understand the system with good accuracy prior to optimization. Our approach is evaluated on six open-source systems and the results have shown the effectiveness of our approach compared to the other existing ones.