Clean the code to respect normes and replace functions by standard oones.