Refactored to use improved local bindings.