Remove console.logs, change functions to function expressions