Removed redundant code on if's