simplified reduce pattern