fixed sonar code violations
if statement simplifications and code duplications
Merge remote-tracking branch 'origin/develop' into develop