change the previous its own function
remove unnecessary lines