move test code to separate source file