small tweaks: remove duplicate if's