Cleanup

Reorganized flow. Added delete, added smarter sleep and better logging.