factor out $achar, $bchar
hyphens and underscores are cheap.
sweeten up the code with in-expression :=