js/main.js: some cleaning + todos