Refactored logic for parsing new variables.