This could be made into a separate function.  Based on your other feedback, though, I will abandon this solution.