support hashref and arrayref args