Refactoring binding flow to expose local and main contexts to all bindings.