code cleanup: removed redundant check