Console log refactoring

refactoring of the console logging