utils refactoring