More code cleanup and added new xml variables to parse through