refactor promises in models