Remove use of toJSON