Refactor to use enum class