fixes some sonar/jenkins issue about "Unnecessary Local Before Return"