Move controller code into own class
Remove spurious console.log calls