extracted NaN and Infinity to contstants / refacored