scripts/title: fix parsing of some titles, refactor