Removing unecessary spaces and console.log