refactor covenant and modify promise accordingly