Refactor unit attr access