refactored back to using enum