Refactored pledge.js and create.js and udpate.js