refactored autoUnit