Use array instead of if statement