Removed contracts, added ifs instead and renamed events