refactoring model of units