build enum map without mutable state