refactoring domain_summary method