Optimized some enum logic away