better to use `SplitN` here, also probably should pull these three lines out in to its own function