apply review comments and rename the bad function name