refactors main.jsx; also makes google parsing a little more robust