Removed some unused variables and combined two nearly identical classes into one.