Factor out array lookup

Just makes it clearer, doesn't make any difference performance-wise.