Extract code for testing undefined