Fix site crashing, refactor parse.js