Refactoring of utils