Code cleanup
Code cleanup - Enum comparsions
Unnecessary unboxing