Removed dependency on toJSON and fromJSON methods