move test file content to __END__ block
eliminate extra function in test