better implementation, and dropping the special handling for 'data'