better approach to supporting data=null case