removed redundant logic