Remove the random console logs and fix the general code structure
Remove the random console logs and fix the general code structure