Safer version with better perfs