Replaced console.log with logger calls