Unify duplicated functions.