Performance improvement. Thanks to Ruben Arroyo