Solid refactor of speech code.