Update utils.py

The code is repeated. why not function call directly