ENH: Possible performance improvement