refactoring alert() -> console.log()