improve variable config generateValue method