remove unnecessary local variables