Refactor unit view