added pledge factory and wrote unit test for pledge model