factories return promices insted of callback function