refactor bindings to return hash