code cleaning : log() added