remove unnecessary `undef` variables