Major performance improvements

But still work TODO