Fix: some code optimization

2 jobs for master in 6 minutes and 44 seconds
latest
Status Job ID Name Coverage
  Build And Test With Sonar Concurrently
passed build-master #32862

00:02:42

passed sonarqube #32863

00:04:01