some changes following code inspection suggestions