Refactor GenerateHandleTester