Added some performance improvements