code cleanup and start on delete of activity