More extraction of constants and logging improvement