Reviewed code after sonar issues