slight improvement to `extendData` method