a better alternative for .then method