Consolidate if/else