added refined toJSON