Sonar :
- Refactor refactor to reduce the complexity