huge refactor - correct code for index.erb; parser not working