Fixing performance issues