scripts/alphabet: refactor