Major cleanup and kill sql