Use constants for codes instead of a map with string keys