Switch to templates for the binding code