cleaned up sales engine code