removing unnecessary if