cleaning up delta optim. code