remove unnecessary if stmt