[BROKEN BACKWARD COMPATIBLITY] small refactoring - utils.py