Remove unnecesarry logic part

To improve readability, duplicate codes are removed.