Factoring forward slash scanning out to its own function