remove unnecessary if condition