Refactor: extract ifs() method.