added back cls helper for json encoding