implement Promise.builder and refactors constructors