Extract out test code into own file