ML: main.js cleaned up a bit