Make array init code use tables instead of repeated code