refactor afax a bit