This function is just begging to be pulled out, I needed to use it directly.