use objects instead of function for promises