Eliminate repeated and costant strlen() calls
Avoid looking up global variables again and again