utils refactored