Put test code into own function.