refactor inverseCase