refactor(cloudfunc) Util: check, render