refactor of units