updated contracts and singlton factory