Fixed variable value quoting
Removed no-longer used variable and collapsed logic