I think we should have some tests for this function directly too? ping @samccone