created a common method to get variable names