Cleaning code following Cyrille Leclerc comments