Remove extra unused variables, general cleanup