Shouldn't this function be exported so you can use the same one in the test?