changed some things to please sonar