improve assign to simplify call with single index