cleanup old if implementation