The if else blocks have been replaced by the use of reflection. An internal private class has been created within VariableManager called SystemVariables. This class has a collection of public methods that each return a string and start with "var_". An attempt is made to obtain a method based on the variable name being referenced. If a NoSuchMethodException is thrown we then know that the variable name is not a system variable and we then try the other cases such as page variables and request headers.
This change greatly increases the readability of the getValue method and trivializes adding new system variables.