Cast data to array so we can remove an if statement