Removing unused code and  console.log