Use promise from codebox instead of q