Use Promise.cast instead of if/then