improve the utils for animate lib