restructuring + support for custom summary methods