refactor to delete track and better failure handling