Implement Chain-of-responsibility pattern.