model utils refactoring