Remove console.log and clean up code