handle capture options in less redundant way

we had essentially the exact same code in both branches of the if
statement here, I used a hash merge to only have it appear once (also
added a few comments for future clarity)