IIS-related functions were refactored and extended. Sample code was corected