Removing unnecessary if clause