refactored sendy update code