keep cleaner

When I reading the source code, found during the following two functions can actually be more cleaner