utils refactor