slightly improved readability of NAN-related code