[FaceRest] Unify duplicated code