refactoring model utils