changed mode to use hash instead of cnstant, separated enabled value from mode