remove redundant logic code.