Convert promised code to use node style callbacks