Moving the testing to a separate function.