remove redundancy code fragments