Refacotring the Json Serialization of the enum