move conditions restructure logic out of summary