rmeoved unnecessary if's