Refactor slash handling slightly.