Performance optimizations and better compatibility