Refactor with the PHP max() function