some better variable specificity and code cleanup