Changed Type and Code to Enum