little cleaning for repeated if