moved instance method to become static helper function to check whether variable names were valid