Consolidate IF statement