fix up parsing and displaying; refactor slightly