can this line be moved to out of `if`?