Changing switch to array lookup for slight performance increase