remove duplicated function and some other stuff