Updated code to comply with ReShaper coding rules