refactored for promised based stuff only