added a logger to format messages, removed console.log