another attempt at some performance improvement