Rewrite existing code with dynamic binding pattern