Attempting some performance improvements.