Performance improvements

Hope this makes sense