Refactor out console.logs